package com.gwd.task.model;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.gwd.task.entity.FilesUploadEntity;
import com.gwd.task.entity.map.FileLookUpload;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author zhiyongming
 * @date 2021/1/25 17:45
 * 文档上传表
 */
@Data
@NoArgsConstructor
public class FilesUploadDTO {
    private Long fuId;
    private Long groupId;
    private Integer type;
    private String explain;
    private String uploadTime;
    private Long uploadUser;
    private String uploadUserName;
    private String fileCode;
    private String fileName;
    private Integer isLookUp;//是否已阅

    public FilesUploadDTO(FilesUploadEntity entity) {
        BeanUtil.copyProperties(entity, this, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(false));
    }

    public FilesUploadDTO(FileLookUpload model) {
        this.fuId = model.getFuId();
        this.groupId = model.getGroupId();
        this.type = model.getFuType();
        this.explain = model.getFuExplain();
        this.uploadTime = model.getUploadTime();
        this.uploadUser = model.getUploadUser();
        this.fileCode = model.getFileCode();
        this.isLookUp = model.getIsLookUp();
        this.fileName = model.getFileName();
        this.uploadUserName = model.getUserName();
    }

    public Long getUploadUser() {
        return uploadUser;
    }

    public void setUploadUser(Long uploadUser) {
        this.uploadUser = uploadUser;
    }

    public String getUploadUserName() {
        return uploadUserName;
    }

    public void setUploadUserName(String uploadUserName) {
        this.uploadUserName = uploadUserName;
    }
}
